<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>真然资本——后台登录</title>
	<script src="__PUBLIC__/admin/js/jquery.js"></script>
	<script>
$(document).ready(function() {
  $("#btn").click(function(){
    if ($.trim($("#username").val())=='') {
      alert('请填写账号！');
      return false;
    }
    if ($.trim($("#password").val())=='') {
      alert('请填写密码！');
      return false;
    }
//    将表单的值串联起来
    var params = $("input").serialize();
//	  后台返回的地址
    var url = "{:U('Admin/Login/check')}";  
    $.ajax({  
        type: "post",  
        url: url,  
        dataType: "json",  
        data: params,  
        success: function(data){  
          if (data.msg=='success') {
            window.location.href="{:U('Admin/Index/newsList')}";
          }else{
            alert('账号或密码错误！');
          }
        }  
      });  

	  
	});
});
</script>
</head>
<style type="text/css">
	.inp{line-height: 30px;height:30px;border-radius: 3px;}
	.div{padding:10px;}
</style>
<body style="background-color:#ccc;">
	<div style="background-color:#ddd;width:260px;height:260px;margin:200px auto;border-radius:8px;padding:20px 50px;box-shadow:2px 2px 2px 2px;">
		<h3><span style="font-size:24px;padding:0 10px;">真然资本</span>后台管理系统</h3>
		<div class="div"><span>账号：</span><input type="text" name="username" class="inp" id="username"></div>
		<div class="div"><span>密码：</span><input type="password" name="password" class="inp" id="password"></div>
		<div style="width:100px;margin:20px 0 0 180px;"><input type="button" id="btn" value="登录" style="cursor:pointer;outline:none;padding:5px 10px;border-radius:5px;border:1px solid gray;"></div>
	</div>
</body>
</html>